﻿@using Equation.Enterprise.Framework.Web.Model
@using ENail.Portal.Web.Models
@using MvcContrib.UI.Pager
@using MvcContrib.UI.Grid 
@using MvcContrib.Pagination
@model GenericListViewModel<ENail.Portal.Web.Models.TaskListViewItem>


<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            FirstName
        </th>
        <th>
            LastName
        </th>
        <th>
            Made
        </th>
        <th>
            Waiting
        </th>
        <th></th>
    </tr>
    
@*@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.FirstName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LastName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Made)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Waiting)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}*@

                @Html.Grid(Model.List).Columns((column) =>
                                                {
                                                    column.For(x => x.FirstName)
                                                            .Named("First Name")
                                                            .Attributes(width => "50px");
                                                    column.For(x => x.LastName)
                                                            .Named("Last Name")
                                                            .Attributes(width => "50px");
                                                    column.For(x => x.Made)
                                                            .Named("Made")
                                                            .Attributes(width => "30px");
                                                    column.For(x => x.Waiting)
                                                            .Named("Waiting")
                                                            .Attributes(width => "30px");
                                                    
                                                }
                                        ).Attributes(@class => "grid"
                                        ).HeaderRowAttributes(new Dictionary<string, object> { { "class", "gridheaderrow" } }
                                        ).RowAttributes(row => new Dictionary<string, object> { { "onclick", "document.location='" + Url.Action("Update", new { Id = row.Item.Id }) + "'"} })

</table>
